#include <iostream>
#include "TransCodes.h"
using namespace std;
MySocket so;
int main(int argc, char** argv) {
    if (argc!=3) {
        fprintf(stderr, "usage %s: server_addr port\n", argv[0]);
        exit(-1);
    }
    int port = atoi(argv[2]);
    cout<<port<<endl;
    int csock = so.openClientfd(argv[1], port);
    cout<<csock<<endl;
    if (csock < 0) {
        fprintf(stderr, "client socket open error!\n");
        exit(-2);
    }
    TransCode trans(csock);
    trans.putLine((char*)"Hello, \r\nthis is a file.");
    trans.transFile((char*)"./MyNet.cpp");
    trans.Close();
    return 0;
}
